package com.education.controller;

import com.education.domain.Tbclass;
import com.education.domain.Tbtest;
import com.education.service.ClassService;
import com.education.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by zhangjiawen on 2019/11/19.
 */
@RestController
@RequestMapping("/test")
public class TestController {
    Logger logger= LoggerFactory.getLogger(this.getClass());
    @Autowired
    private TestService testService;


    @RequestMapping("/getByCondition")
    public  Object selectByExample(@RequestBody Map map) {
        if(map.size()==0){
            return null;
        }
        //接收前端传递的map
        Tbtest test=new Tbtest();

        if(map.get("lClassId")!=null){
            test.setLclassid(Integer.parseInt((String) map.get("lClassId")));

        }
        return  testService.getByCondition(test);

    }






}
